//使用express构建web服务器
const express = require('express')
const bodyParse = require('body-parser')
var cors = require('cors')

/*引入路由模块*/
const User = require("./routes/user")
const Student = require("./routes/student")

var app = express()
app.use(cors({
  origin:['http://localhost:8080'],
  credentials: true
}))
app.listen(3000)

app.use(bodyParse.urlencoded({ extended: false }))

/*使用路由器来管理路由*/
app.use("/user", User)
app.use("/student", Student)
